/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { AddChartDto } from '../models/AddChartDto';
import type { BaseResponse_GenChartVo_ } from '../models/BaseResponse_GenChartVo_';
import type { BaseResponse_object_ } from '../models/BaseResponse_object_';
import type { BaseResponse_PageVo_ } from '../models/BaseResponse_PageVo_';
import type { EditChartDto } from '../models/EditChartDto';
import type { QueryChartDto } from '../models/QueryChartDto';

import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';

export class ChartControllerService {

    /**
     * addChart
     * @param dto dto
     * @returns BaseResponse_object_ OK
     * @returns any Created
     * @throws ApiError
     */
    public static addChartUsingPost(
dto: AddChartDto,
): CancelablePromise<BaseResponse_object_ | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/chart/addChart',
            body: dto,
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * deleteChart
     * @param id id
     * @returns BaseResponse_object_ OK
     * @throws ApiError
     */
    public static deleteChartUsingDelete(
id?: number,
): CancelablePromise<BaseResponse_object_> {
        return __request(OpenAPI, {
            method: 'DELETE',
            url: '/api/chart/deleteChart',
            query: {
                'id': id,
            },
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
            },
        });
    }

    /**
     * editChart
     * @param dto dto
     * @returns BaseResponse_object_ OK
     * @returns any Created
     * @throws ApiError
     */
    public static editChartUsingPut(
dto: EditChartDto,
): CancelablePromise<BaseResponse_object_ | any> {
        return __request(OpenAPI, {
            method: 'PUT',
            url: '/api/chart/editChart',
            body: dto,
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * genChartByAI
     * @param goal 
     * @param name 
     * @param file 
     * @param chartType 
     * @returns BaseResponse_GenChartVo_ OK
     * @returns any Created
     * @throws ApiError
     */
    public static genChartByAiUsingPost(
goal: string,
name: string,
file?: Blob,
chartType?: string,
): CancelablePromise<BaseResponse_GenChartVo_ | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/chart/genChartByAI',
            query: {
                'chartType': chartType,
                'goal': goal,
                'name': name,
            },
            formData: {
                'file': file,
            },
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * queryChartPage
     * @param dto dto
     * @returns BaseResponse_PageVo_ OK
     * @returns any Created
     * @throws ApiError
     */
    public static queryChartPageUsingPost(
dto: QueryChartDto,
): CancelablePromise<BaseResponse_PageVo_ | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/chart/queryChartPage',
            body: dto,
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

}
